"""
异常捕获

"""
# 基本语法
# 捕获所有异常
# try:
#     open("dada.txt","r")
# except:
#     open("dada.txt","w")
# 捕获指定异常
# try:
#     print(name)
# except NameError as e:
#     print("出现了名字未定义的异常")
#捕获多个异常
# try:
#     print(1/0)
# except (ZeroDivisionError,NameError) as e:
#     print(e)
# # 捕获多个异常
# try:
#     print(1/0)
# except Exception as e:
#     print(e)
# # 若无异常则执行
# else:
#     print("success")
# finally:
#     f=open("da.txt","a").write("success")
"""

功能包的调用

"""
# import time #调用time这个模块
# from time import sleep #从time这个包调用slee这个方法
# time.sleep()
# sleep()
# from time import *#调用time这个模块里的所有函数 和第一种的区别就是 一个从包调用方法 一个直接调用
# from time import sleep as sl
# sl()

"""

自定义功能包

"""
#
# from my_package.hello_package import hello
# hello()
#
# import my_package.hello_package
#
# from my_package import hello_package
# hello_package.hello()

import my_package.hello_package
